public class PlayerGroundState : PlayerState
{
    private bool __isGrab;
    private CollisionSenses _collisions;
    private bool _Dashinput;
    protected int _inputX;
    protected int _inputY;

    private bool _isGrounded;
    protected bool _isTouchingCeiling;
    private bool _isTouchingLedge;
    private bool _isTouchingWall;
    private bool _jumpInput;
    private Movement _movement;
    private bool _PrimaryAttackInput;
    private bool _SecondaryAttackInput;

    public PlayerGroundState(Player player, PlayerSM stateMachine, PlayerData playerData, string animBoolName,
        Core core) : base(player, stateMachine, playerData, animBoolName, core)
    {
    }

    protected Movement Movement => _movement ??= _core.GetCoreComponent<Movement>();

    private CollisionSenses CollisionSense => _collisions ??= _core.GetCoreComponent<CollisionSenses>();

    public override void DoChecks()
    {
        base.DoChecks();

        _isGrounded = _core.Collision.Grounded;
        _isTouchingLedge = _core.Collision.LedgeHorizontal;
        _isTouchingWall = _core.Collision.WallFront;
        _isTouchingCeiling = _core.Collision.Ceiling;
    }

    public override void Enter()
    {
        base.Enter();

        _player.JumpState.ResetJumpCount();
        _player.DashState.ResetCanDash();
    }

    public override void Exit()
    {
        base.Exit();
    }

    public override void LogicUpdate()
    {
        base.LogicUpdate();
        if (!_isExitingState)
        {
            _inputX = LightInputManager.Instance.NormalInputX;
            _inputY = LightInputManager.Instance.NormalInputY;
            _jumpInput = LightInputManager.Instance.JumpInput;
            __isGrab = LightInputManager.Instance.GrabInput;
            _Dashinput = LightInputManager.Instance.DashInput;
            _PrimaryAttackInput = LightInputManager.Instance.AttackInputs[(int)CombatInputs.Primary];
            //_SecondaryAttackInput = LightInputManager.Instance.AttackInputs[(int)CombatInputs.Secondary];

            if (_PrimaryAttackInput && !_isTouchingCeiling)
            {
                _stateMachine.ChangeState(_player.PrimaryAttackState);
            }
            else if (_SecondaryAttackInput && !_isTouchingCeiling)
            {
                _stateMachine.ChangeState(_player.SecondAttackState);
            }
            else if (_jumpInput && _player.JumpState.CanJump() &&
                     !_isTouchingCeiling) //MARKER:�������ƺ���Ծ���ûɶ���ã����ǿ��Ը���Ծ���ϸ����ʱ�䡣
            {
                _stateMachine.ChangeState(_player.JumpState);
            }
            else if (!_isGrounded)
            {
                _player.InAirState.StartCoyoteTime();
                _stateMachine.ChangeState(_player.InAirState);
            }
            else if (__isGrab && _isGrounded && _isTouchingLedge && _isTouchingWall)
            {
                _stateMachine.ChangeState(_player.WallGrabState);
            }
            else if (_Dashinput && _player.DashState.CheckIfCanDash() && !_isTouchingCeiling)
            {
                _stateMachine.ChangeState(_player.DashState);
            }
        }
    }

    public override void PhysicsUpdate()
    {
        base.PhysicsUpdate();
    }
}